package org.example;

import java.util.ArrayList;

public class Example<K, L extends SuperClass, M> extends SuperClass implements SuperInterface {
    public K kField;

    public void publicMethod(int a) {
        publicMethod(1);
        protectedMethod(2);
        privateMethod(a);
    }

    protected void protectedMethod(int b) {
        publicMethod(b);
        protectedMethod(2);
        privateMethod(3);
    }

    private void privateMethod(int c) {
        publicMethod(1);
        protectedMethod(c);
        privateMethod(3);
    }

    public void interfaceMethod() {
        int i = 123;
        int j = i * 5;
        switch (j) {
            case 1:
                double a = 1;
                break;
            case 2:
                double b = 2;
                break;
            case 3:
                double c = 3;
                break;
            case 4:
                double d = 4;
                break;
            default:
                double e = 5;
                break;
        }
    }

    public Example returnExample() {
        return new Example();
    }

    public void differentInvocationsTest(int a, Example e1, Example e2, int b) {
        superMethod();
        super.superMethod();

        SuperInterface si = returnExample();
        int i = 5;
        si.interfaceMethod();
    }

    public void tryCatchTest(int i) {
        try {
            int asd = 123;
        } catch (RuntimeException asdsa) {
            asdsa.printStackTrace();
        }
    }

    public K genericTest1(L a, M b, double c, K d) {
        L aa = a;
        M bb = b;
        ArrayList<String> arrayListTest = new ArrayList<String>();
        L.staticMethod();
        c = 45.5;
        return d;
    }

    public <R, S extends SuperClass, T> T genericTest2(K a, T b, R d) {
        K aa = a;
        R dd = d;
        S.staticMethod();
        return b;
    }
}